package com.magic.uschat.bean;

import com.lidroid.xutils.db.annotation.Column;
import com.lidroid.xutils.db.annotation.Finder;
import com.lidroid.xutils.db.annotation.Id;
import com.lidroid.xutils.db.annotation.NoAutoIncrement;
import com.lidroid.xutils.db.annotation.Table;
import com.lidroid.xutils.db.annotation.Unique;

@Table(name="dbuser")
public class DbUser {
	
	@Id
	@NoAutoIncrement
	@Finder(valueColumn="objectId",targetColumn="friendId")
	private String objectId;
	@Column(column="username")
	private String username;
	@Column(column="avatar")
	private String avatar;
	@Column(column="sex")
	private String sex;
	@Column(column="email")
	private String email;
	/*
	@Column(column="emailVerified")
	private boolean emailVerified;
	*/
	@Column(column="phoneNumber")
	private String phoneNumber;
	
	@Column(column="nickname")
	private String nickname;
	@Column(column="signature")
	private String signature;
	
	
	public String getNickname() {
		return nickname;
	}


	public void setNickname(String nickname) {
		this.nickname = nickname;
	}


	public String getSignature() {
		return signature;
	}


	public void setSignature(String signature) {
		this.signature = signature;
	}


	public DbUser(){}
	

	public String getObjectId() {
		return objectId;
	}

	public void setObjectId(String objectId) {
		this.objectId = objectId;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getAvatar() {
		return avatar;
	}

	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPhoneNumber() {
		return phoneNumber;
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	public DbUser(User user){
		this.username = user.getUsername();
		this.objectId = user.getObjectId();
		this.avatar = user.getAvatar();
		this.email = user.getEmail();
		this.phoneNumber = user.getMobilePhoneNumber();
		//this.emailVerified = user.getEmailVerified();
		this.sex = user.getSex();
		this.nickname = user.getNickname();
		this.signature = user.getSignature();
	}
	
	public User toUser(){
		User user = new User();
		user.setObjectId(objectId);
		user.setEmail(email);
		user.setUsername(username);
		user.setAvatar(avatar);
		user.setMobilePhoneNumber(phoneNumber);
		//user.setEmailVerified(emailVerified);
		user.setSex(sex);
		user.setNickname(nickname);
		user.setSignature(signature);
		return user;
	}
	
}
